#!/usr/bin/env python
# -*- coding: utf-8 -*-

import dynamic_reconfigure.parameter_generator_catkin as param

gen = param.ParameterGenerator()

## automated function control group
auto_func_group = gen.add_group("Auto function control");
gain_auto_desc = "Control the Gain Auto function."
gain_auto = gen.enum([
        gen.const("Gain_Manual", param.str_t, "Manual", "Disables the Gain Auto function."),
        gen.const("Gain_Continuous", param.str_t, "Continuous", "Sets the auto function mode of operation to - continuous."),
    ], gain_auto_desc)

auto_func_group.add("Gain_auto", param.str_t, 0, gain_auto_desc, default="Continuous", edit_method=gain_auto)

exposure_auto_desc = "Control the exposure auto function."
exposure_auto = gen.enum([
        gen.const("Exposure_Manual", param.str_t, "Manual", "Disables the exposure auto function."),
        gen.const("Exposure_Continuous", param.str_t, "Continuous", "Sets the exposure auto function mode of operation to - continuous."),
    ], exposure_auto_desc)

auto_func_group.add("Exposure_auto", param.str_t, 0, exposure_auto_desc, default="Continuous", edit_method=exposure_auto)

## manual control group
manual_func_group = gen.add_group("Manual function control")
gain_desc = "This float value sets the camera's gain."
manual_func_group.add("Gain", param.double_t, 0, gain_desc, default=1, min=0, max=100)
exposure_time_desc = "This float value sets the cameras exposure time in microseconds."
manual_func_group.add("Exposure_time", param.double_t, 0, exposure_time_desc, default=59, min=0, max=200)
manual_func_group.add("Red_gain", param.double_t, 0, gain_desc, default=60, min=0, max=100)
manual_func_group.add("Green_gain", param.double_t, 0, gain_desc, default=60, min=0, max=100)
manual_func_group.add("Blue_gain", param.double_t, 0, gain_desc, default=60, min=0, max=100)

gen.add("Trigger_WB", param.bool_t, 0, "Trigger White Balance", default = True)
exit(gen.generate("mv_camera", "mv_camera", "Camera"))
